.container {
  width: 320px;
  padding: 16px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: relative;
}

h2 {
  text-align: center;
  margin-bottom: 16px;
  color: #333;
}

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

input[type="text"],
input[type="password"] {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

button {
  padding: 4px 6px;
  margin: 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  font-size: 12px;
}

button[type="submit"] {
  background-color: #4CAF50;
  color: white;
}

button[type="submit"]:hover {
  background-color: #45a049;
}

#clear-all {
  background-color: #f44336;
  color: white;
}

#clear-all:hover {
  background-color: #d32f2f;
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}

li {
  background-color: #fff;
  margin: 6px 0;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  word-break: break-word;
  font-size: 13px;
  position: relative;
  transition: background-color 0.2s ease;
  overflow: hidden;
}

li:hover {
  background-color: #f0f8ff;
}

.password-info {
  word-break: break-all;
}

.password-info strong {
  color: #333;
  font-weight: bold;
}

.button-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.button-group button {
  flex-shrink: 0;
  padding: 2px 4px;
  font-size: 12px;
}

/* 删除按钮 */
.button-group button:nth-child(1) {
  background-color: #ff9800;
}

.button-group button:nth-child(1):hover {
  background-color: #fb8c00;
}

/* 浮动添加按钮 */
#toggle-add-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 18px;
  line-height: 24px;
  text-align: center;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#toggle-add-btn:hover {
  background-color: #1976d2;
}

/* 点击波纹动画 */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 150, 255, 0.3);
  width: 100px;
  height: 100px;
  pointer-events: none;
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 右键菜单样式 */
.context-menu {
  position: absolute;
  background-color: #fff;
  border: 1px solid #999;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 9999; /* 确保在最上层 */
  display: none;
  flex-direction: column;
  min-width: 120px;
  max-width: 200px;
}

.menu-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #333;
}

.menu-item:hover {
  background-color: #f0f0f0;
}